home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / tcp_ip / tnos / tnos100s / asyvec.asm < prev    next >
Encoding:
Assembly Source File  |  1993-03-24  |  3.5 KB  |  164 lines

  1. ; ASY (8250/16450/16550A "comm" port) interrupt hooks
  2. ; Copyright 1991 Phil Karn, KA9Q
  3.  
  4. ;%    .MODEL  MEMMOD,C
  5. include asmglobal.h        
  6.     %MACS
  7.  
  8.     extrn   doret:proc,asyint:far,eoi:proc
  9.  
  10.     .DATA
  11.     extrn   Sssave:word
  12.     extrn   Spsave:word
  13.     extrn   Stktop
  14.  
  15.     .CODE
  16. dbase   dw      @Data
  17.  
  18. ; asy0vec - asynch channel 0 interrupt handler
  19.     public  asy0vec
  20.     label   asy0vec far
  21.     push    ds              ; save on user stack
  22.     mov     ds,cs:dbase     ; establish interrupt data segment
  23.  
  24.     mov     Sssave,ss       ; stash user stack context
  25.     mov     Spsave,sp
  26.  
  27.     mov     ss,cs:dbase
  28.     lea     sp,Stktop
  29.  
  30.       ;  push    ax              ; save user regs on interrupt stack
  31.       ;  push    bx
  32.       ;  push    cx
  33.       ;  push    dx
  34.       ;  push    bp
  35.       ;  push    si
  36.       ;  push    di
  37.     PUSHALL
  38.     push    es
  39.     call    eoi
  40.  
  41.     mov     ax,0            ; arg for service routine
  42.     push    ax
  43.     call    asyint
  44.     pop     ax
  45.     jmp     doret
  46.  
  47. ; asy1vec - asynch channel 1 interrupt handler
  48.     public  asy1vec
  49.     label   asy1vec far
  50.     push    ds              ; save on user stack
  51.     mov     ds,cs:dbase     ; establish interrupt data segment
  52.  
  53.     mov     Sssave,ss       ; stash user stack context
  54.     mov     Spsave,sp
  55.  
  56.     mov     ss,cs:dbase
  57.     lea     sp,Stktop
  58.  
  59.       ;  push    ax              ; save user regs on interrupt stack
  60.       ;  push    bx
  61.       ;  push    cx
  62.       ;  push    dx
  63.       ;  push    bp
  64.       ;  push    si
  65.       ;  push    di
  66.     PUSHALL
  67.     push    es
  68.     call    eoi
  69.  
  70.     mov     ax,1            ; arg for service routine
  71.     push    ax
  72.     call    asyint
  73.     pop     ax
  74.     jmp     doret
  75.  
  76. ; asy2vec - asynch channel 2 interrupt handler
  77.     public  asy2vec
  78.     label   asy2vec far
  79.     push    ds              ; save on user stack
  80.     mov     ds,cs:dbase     ; establish interrupt data segment
  81.  
  82.     mov     Sssave,ss       ; stash user stack context
  83.     mov     Spsave,sp
  84.  
  85.     mov     ss,cs:dbase
  86.     lea     sp,Stktop
  87.  
  88.        ; push    ax              ; save user regs on interrupt stack
  89.        ; push    bx
  90.        ; push    cx
  91.        ; push    dx
  92.        ; push    bp
  93.        ; push    si
  94.        ; push    di
  95.     PUSHALL
  96.     push    es
  97.     call    eoi
  98.  
  99.     mov     ax,2            ; arg for service routine
  100.     push    ax
  101.     call    asyint
  102.     pop     ax
  103.     jmp     doret
  104.  
  105. ; asy3vec - asynch channel 3 interrupt handler
  106.     public  asy3vec
  107.     label   asy3vec far
  108.     push    ds              ; save on user stack
  109.     mov     ds,cs:dbase     ; establish interrupt data segment
  110.  
  111.     mov     Sssave,ss       ; stash user stack context
  112.     mov     Spsave,sp
  113.  
  114.     mov     ss,cs:dbase
  115.     lea     sp,Stktop
  116.  
  117.        ; push    ax              ; save user regs on interrupt stack
  118.        ; push    bx
  119.        ; push    cx
  120.        ; push    dx
  121.        ; push    bp
  122.        ; push    si
  123.        ; push    di
  124.     PUSHALL
  125.     push    es
  126.     call    eoi
  127.  
  128.     mov     ax,3            ; arg for service routine
  129.     push    ax
  130.     call    asyint
  131.     pop     ax
  132.     jmp     doret
  133.  
  134. ; asy4vec - asynch channel 4 interrupt handler
  135.     public  asy4vec
  136.     label   asy4vec far
  137.     push    ds              ; save on user stack
  138.     mov     ds,cs:dbase     ; establish interrupt data segment
  139.  
  140.     mov     Sssave,ss       ; stash user stack context
  141.     mov     Spsave,sp
  142.  
  143.     mov     ss,cs:dbase
  144.     lea     sp,Stktop
  145.  
  146.        ; push    ax              ; save user regs on interrupt stack
  147.        ; push    bx
  148.        ; push    cx
  149.        ; push    dx
  150.        ; push    bp
  151.        ; push    si
  152.        ; push    di
  153.     PUSHALL
  154.     push    es
  155.     call    eoi
  156.  
  157.     mov     ax,4            ; arg for service routine
  158.     push    ax
  159.     call    asyint
  160.     pop     ax
  161.     jmp     doret
  162.  
  163.     end
  164.